using System;
using System.Collections.Generic;
using System.Text;
using Presentation.Contracts;
using Task.Contracts;
using DataAccess;
using Globals;
using Task;
using System.Data;

namespace Presentation
{
    public class CVMessagePresenter
    {
        #region Members

        /// <summary>
        /// Instance of view.
        /// </summary>
        private ICVMessageView view;

        /// <summary>
        /// Simple task.
        /// </summary>
        private IMessageTask task;

        #endregion Members

        #region Construction/Finalization

        /// <summary>
        /// Initializes a new instance of the <see cref="AddForumPresenter"/> class.
        /// </summary>
        /// <param name="view">The view.</param>
        public CVMessagePresenter(ICVMessageView view)
        {
            this.view = view;
            task = new MessageTask();
        }

        #endregion Construction/Finalization

        #region Public Methods

        /// <summary>
        /// Initializes view.
        /// </summary>
        public void Initialize()
        {

        }

        public void CreateMessage(string topic,string content )
        {
            task.AddMessage(int.Parse(view.SessionID()),int.Parse(view.UrlID()), topic, content);
        }

        public string GetLogin(int UserId){

            return task.GetLoginOfUser(UserId);
        }

        public int GetUserIdOfSender(int MsgId)
        {
            return task.GetIdOfSender(MsgId);
        }

        public string GetTopicOfMessage(int MsgId)
        {
            return task.GetTitleOfMessage(MsgId);
        }

        public string GetContentOfMessage(int MsgId)
        {
            return task.GetContOfMessage(MsgId);
        }

        #endregion Public Methods

        #region Private Methods

        /// <summary>
        /// Gets the forum object from view.
        /// </summary>
        /// <returns></returns>
       

        #endregion Private Methods
    }
}
    


